<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class RegisterRequest extends BaseRequest
{


    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'username'=>'required|unique:users',
            'password'=>'required',
            'code'=>'required',
            'mobile'=>'required|unique:users'
        ];
    }

    public function messages()
    {
        return[
            'username.required'=>'用戶名不能為空',
            'username.unique'=>'該用户名已被註冊',
            'code'=>"驗證碼不能為空",
            'mobile.required'=>"手機號不能為空",
            'mobile.unique'=>"該手機號已被註冊"
        ];
    }
}
